package tjs.study.notes.dotest.disruptor.apiLog.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by Nicky.Tang on 2022/9/29 上午11:23
 *
 * @since 02.12.10
 */
//@RefreshScope//开启nacos配置文件的监听
@Component
public class DisruptorConfig {
    @Value("${shsnc.project.disruptor.consumerSize:8}")
    private Integer consumerSize;// 消费者数量
    
    @Value("${shsnc.project.disruptor.bufferSize:1024}")
    private Integer bufferSize;// 预热实例数(必须为2的x次幂；注意会常驻内存中)
    
    @Value("${shsnc.project.disruptor.sleepTimeNs:200000}")
    private Integer sleepTimeNs;// 等待策略-休眠时间(纳秒)
    
    @Value("${shsnc.project.disruptor.max-pool-records:1000}")
    private Integer maxPoolRecords;// 单次入库es，最少条数
    
    @Value("${shsnc.project.disruptor.max-pool-interval:5}")
    private Integer maxPoolInterval;// 单次入库es，最少间隔时间（秒）

    public Integer getConsumerSize() {
        return consumerSize;
    }

    public Integer getBufferSize() {
        return bufferSize;
    }

    public Integer getSleepTimeNs() {
        return sleepTimeNs;
    }

    public Integer getMaxPoolRecords() {
        return maxPoolRecords;
    }

    public Integer getMaxPoolInterval() {
        return maxPoolInterval;
    }
}
